#include "hashlibpp.h"
#include "hl_exception.h"
#include <string>
#include <iostream>

//using namespace std;

extern struct
{
   int ii, jj, kk;
} ijk_;

int doubleijk_(char *cc, int ll)
{
   printf("From doubleIJK: %s\n",cc);

   ijk_.ii *=2;
   ijk_.jj *=2;
   ijk_.kk *=2;

   return(1);
}

extern int md5_(std::string& hash_string, std::string& outp) {
	/*
	 * creating a wrapper object
	 */
	hashwrapper *myWrapper = new md5wrapper();
	const char* tmp;

	try {
	        /*
	         * create a hash from a string
	         */

		outp =  myWrapper->getHashFromString(hash_string).c_str();

	} catch(hlException &e) {

	        std::cerr << "Error(" 
	                  << e.error_number()
	                  << "): "
//	                  << e.error_message()
	                  << std::endl;
	}

	delete myWrapper;
	return 1;
}

//int main(int argc, char *argv[]) {
//	std::string hash(argv[1]);
//	std::string outp;
//
//	md5_(hash, outp);
//	cout << outp << endl;
//	return 1;
//}
